#
# This file is a part of the open-eBackup project.
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at
# http://mozilla.org/MPL/2.0/.
#
# Copyright (c) [2024] Huawei Technologies Co.,Ltd.
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
#

from typing import Callable, Tuple, Dict
from pydantic import BaseModel, Field


class ModifyPermission(BaseModel):
    path: str = Field(description="目标路径")
    user: str = Field(None, description="用户")
    mode: int = Field(None, description="权限")
    path_check_func: Callable = Field(None, description="路径校验函数")
    path_check_func_args: Tuple = Field(None, description="路径校验函数位置参数")
    path_check_func_kwargs: Dict = Field(None, description="路径校验函数关键字参数")


class CreateSoftLink(BaseModel):
    src_path: str = Field(description="源路径")
    dst_path: str = Field(description="目标路径")
    src_user: str = Field(None, description="目标路径所属用户")
    src_path_check_func: Callable = Field(None, description="源路径校验函数")
    src_path_check_func_args: Tuple = Field(None, description="源路径校验函数参数")
    dst_path_check_func: Callable = Field(None, description="目标路径校验函数")
    dst_path_check_func_args: Tuple = Field(None, description="目标路径校验函数参数")


class RestoreCmdParam(BaseModel):
    vc: str = Field(None, description="vc名称")
    db_name: str = Field(description="数据库名称")
    db_os_user: str = Field(description="数据库操作用户名")
    gcrcman: str = Field(description="gcrcman路径")
    copy_dir: str = Field(description="副本路径")
    cycle_id: str = Field(description="备份周期id")
    point_id: str = Field(description="备份点id")
